const mongoose = require('mongoose')

const schema = new  mongoose.Schema({
    name:{type:String},
    avatar:{type:String},
    alias:{type:String},
    banner:{type:String},
    categories:[{type:mongoose.SchemaTypes.ObjectId,ref:"Category"}],
    scores:{
        diffcult:{type:Number},
        skill:{type:Number},
        battle:{type:Number},
        survival:{type:Number},
    },
    skills:[{
        icon:{type:String},
        name:{type:String},
        info:{type:String},
        tips:{type:String},
        cd:{type:String},
        cost:{type:String}
    }],
    equips:{
        easy:[{type:mongoose.SchemaTypes.ObjectId,ref:'Item'}],
        hard:[{type:mongoose.SchemaTypes.ObjectId,ref:'Item'}]
    },
    usageTips:{type:String},
    battleTips:{type:String},
    teamTips:{type:String},
    relations:{
        partner:[
            {
                hero:{type:mongoose.SchemaTypes.ObjectId,ref:'Hero'},
                tip:{type:String}
            }
        ]
    }
})

module.exports = mongoose.model('Hero',schema,'heroes')